<!DOCTYPE html>
<html>
<body>

<?php
echo "-------------------------------- turl begin ---------------------------------\n";

echo "curl version:".var_export(curl_version()).PHP_EOL;

//-----------------------------------------------------
//post方式发送url
function postUrl($url, $data) {
    $data = json_encode($data);
    $head_array = array(
        "Content-type:application/json;charset='utf-8'",
        "Accept:application/json"
    );
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,FALSE);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
    curl_setopt($curl,CURLOPT_HTTPHEADER,$head_array);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $out_put = curl_exec($curl);
    curl_close($curl);
    return json_encode($out_put, true);
}

$key = "2FrWpAiCykeFCWoyezRovt6o56miitqc";
$now = (int)gettimeofday(true);

/* postUrl(
    "47.96.22.83:8180/svjh/sys/reload_account", 
    array(
        "account"=>10386, 
        "timestamp"=>$now,
        "sign"=>md5($key.$now)
    )
); */

echo "-------------------------------- turl end ---------------------------------\n";
?>

</body>
</html>

